﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Particle_Editor
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            //Application.Run(new Form1());

            Form1 the_form = new Form1();
            the_form.Initialize();
            the_form.Show();

            System.DateTime current_time = new System.DateTime();
            current_time = System.DateTime.Now;

            while (the_form.Looping)
            {
                System.DateTime time_now = new System.DateTime();
                time_now = System.DateTime.Now;

                TimeSpan elapsed;

                elapsed = time_now - current_time;
                current_time = time_now;

                float elapsed_time = ((float)elapsed.TotalMilliseconds);

                the_form.Update(elapsed_time);

                //Render Functions here
                the_form.Render();
                the_form.RenderImageSelectionPanel();

                Application.DoEvents();


            }
            the_form.Terminate();
        }
    }
}
